package com.nny.alarm.edit.adapter;

import java.util.Calendar;

import android.content.Context;

import com.nny.alarm.edit.DialAdapter;
import com.uxwine.skin.Skin;

public class YearAdapter extends DialAdapter
{
	int mnYear;
	
	public YearAdapter(Context ctx, int year)
	{
		super(ctx);
		mnYear = Calendar.getInstance().get(Calendar.YEAR);
		if(mnYear > year)
			mnYear = year;
		mnMax = mnYear + 7;
		setPosition(year - mnYear);
	}
	
	@Override
	public String getMarkText(int index)
	{
		return (mnYear + index) + "";
	}

	@Override
	public int getMarkCount()
	{
		return 8;
	}

	@Override
	public int getBtnDrawable()
	{
		return Skin.getDrawable(mCtx, "dial_nav_year");
	}

	@Override
	public int getDialDrawable()
	{
		return Skin.getDrawable(mCtx, "dial_mark_8");
	}

	@Override
	public long getValue(int position)
	{
		return mnYear + position;
	}
}
